import http from "@/utils/http";

export const createClient = (type="mqtt", data) => {
    return http.post(`client/${type}/`, data)
}

export const getClients = () => {
    return http.get("client/list/")
}

export const getClientDetail = (name) => {
    return http.get("client/", { params: { name } })
}

export const updateClient = (name, data) => {
    return http.put("client/", data, { params: { name } })
}
/**
 * 删除指定名称的客户端
 * @param {String} name - 将要删除的客户端名称
 * @return {Promise<Object>}
 */
export const removeClient = (name) => {
    return http.delete("client/", { params: { name } })
}
